/* eslint-disable max-len */

import { judgePortName } from '@/units'
const PathList = [
  {
    path: '/index',
    exact: true,
    component: () => import('../pages/app/MenuApp.vue'),
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: 'index',
        meta: { title: '首页', module: '首页' },
        component: () => import('../pages/index/index.vue'),
      },
    ],
  },
]
// 公用路由
const pageList = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../pages/login/index.vue'),
  },
  {
    path: '/404',
    name: '404',
    component: () => import('../pages/404/index.vue'),
  },
]

const routes = [...pageList, ...PathList]

const pageHaveMenuList = () => {
  const MenuList = {
    enterprise: [
      {
        label: 'page1',
        value: 'page1',
        children: [
          { label: 'page1-1', value: '', path: '' },
          { label: 'page1-2', value: '', path: '' },
        ],
      },
    ],
    park: [
      {
        label: '首页',
        value: '',
        jurisdiction: '24',
        path: '',
        children: [],
      },
      {
        label: '人员管理',
        value: '',
        jurisdiction: '24',
        path: '',
        children: [
          { label: '人员列表', value: '', path: '' },
        ],
      },
    ],
  }

  const loginMode = judgePortName()
  return MenuList[loginMode]
}

const commonPath = () => {
  const paths = {
    park: {
      home: '/home',
      personal: '/personal',
    },
  }
  const loginMode = judgePortName()
  return paths[loginMode]
}

export { routes, pageHaveMenuList, commonPath }
